package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootSociaty;
import org.footballmanager.pandafootball.system.domain.enums.ZDZT;
import org.footballmanager.pandafootball.system.form.SearchForm;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Setter
@Getter
public class FootSociatySearchForm extends SearchForm implements Serializable {
    private static final long serialVersionUID = 8090668615941861340L;
    protected String name;
    protected ZDZT zdzt;
    protected Long danGradingId;

    public Example buildSearchCommond() {
        Example example = new Example(FootSociaty.class);
        Example.Criteria criteria = example.createCriteria();
        if(!StringUtils.isEmpty(name)){
            criteria.andLike("name", "%" + name + "%");
        }
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("jf desc");
        return example;
    }

}
